package stz.flash.main;

import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Field;
import blackberry.util.image.DjImageCalculator;

public class ImageXY {

	//이미지의 XY좌표를 조정할때 이용
	public static final int WIDTH_OF_REAL_IMAGE = 480;
	public static final int HEIGHT_OF_REAL_IMAGE= 800;
	
	//이미지의 크기를 조정할때 이용
	public static final int WIDTH_OF_VIRTUAL_IMAGE = 480;
	public static final int HEIGHT_OF_VIRTUAL_IMAGE= 320;

	//Flashlight
	public static final int WIDTH_OF_TEXT_IMAGE = 480;
	public static final int HEIGHT_OF_TEXT_IMAGE = 83;
	
	public static final int[] LED = new int[] {
		0, 
		refineYIntoDisplay(542)};
	
	public static final int[] BACKLIGHT = new int[] {
		0, 
		refineYIntoDisplay(624)};
	
	public static final int[] FLASHLIGHT = new int[] {
		0, 
		refineYIntoDisplay(706)};
	
	//Strobe
	public static final int[] CONTROL_BAR = new int[] {
		imageXIntoDisplay(WIDTH_OF_REAL_IMAGE + 428), 
		refineYIntoDisplay(512)};
	
	//Glabal
	public static final int[] BULB = new int[] {
		0, 
		refineYIntoDisplay(554)};
	
	/*
	 * HotkeyAdvice
	 */
	public static final int[] L_hotkey = new int[] {
		imageXIntoDisplay(361), 
		refineYIntoDisplay(536)};
	
	public static final int[] B_hotkey = new int[] {
		imageXIntoDisplay(135), 
		refineYIntoDisplay(618)};

	public static final int[] SPACE_hotkey = new int[] {
		imageXIntoDisplay(104), 
		refineYIntoDisplay(699)};

	/**
	 * 계산 메서드들 
	 */
	private static int imageXIntoDisplay(int x) {
		return DjImageCalculator.imageXIntoDisplay(x, WIDTH_OF_REAL_IMAGE);
	}
	
	private static int refineYIntoDisplay(int y){
		return DjImageCalculator.refineYIntoDisplay(
				y, 
				WIDTH_OF_REAL_IMAGE, 
				HEIGHT_OF_REAL_IMAGE, 
				Field.FIELD_TOP);
	}
}
